<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 位运算：1.实现两个数交换，2.判断奇数偶数 -->
    <script>
        var num1 = 10 ; 
        var num2 = 20;
        console.log('交换前：'+num1 +":"+num2)
        var tap = num1;
        num1 = num2 ;
        num2 = tap ;
        console.log('交换后:'+num1+":"+num2);
    </script>

    <script>
        //.判断奇数偶数
        var sava = prompt('请输入一个数值判断奇数偶数');
        if(sava===0){
            alert('不是奇数也不是偶数')
        }if(sava%2!=0){
            alert('是奇数')
        } else if(sava%2==0){
            alert('是偶数');
        }
    </script>
</body>
</html>